home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / TeXsource / commontex / h / box < prev    next >
Encoding:
Text File  |  1988-04-08  |  3.4 KB  |  160 lines

  1. /*
  2.  *    Copyright 1986, 1987 Pat Joseph Monardo. All rights reserved.
  3.  *    Copying of this file is granted according to the provisions 
  4.  *    specified in the file COPYING which must accompany this file.
  5.  */
  6.  
  7.  
  8. /*
  9.  *        box.h
  10.  */
  11.  
  12. #define    type(M)                mem[M].hh.hh2.b0
  13. #define    subtype(M)            mem[M].hh.hh2.b1
  14.  
  15. #define    font                type
  16. #define    character            subtype
  17. #define    is_char_node(M)        (M >= hi_mem_min)
  18.  
  19. ptr    new_null_box();
  20.  
  21. #define    HLIST_NODE            0
  22. #define    VLIST_NODE            1
  23.  
  24. #define    BOX_NODE_SIZE        7
  25. #define    WIDTH_OFFSET        1
  26. #define    DEPTH_OFFSET        2
  27. #define    HEIGHT_OFFSET        3
  28. #define    SHIFT_OFFSET        4
  29. #define    LIST_OFFSET            5
  30. #define    GLUE_OFFSET            6
  31. #define    width(B)            mem[B + WIDTH_OFFSET].sc
  32. #define    depth(B)            mem[B + DEPTH_OFFSET].sc
  33. #define    height(B)            mem[B + HEIGHT_OFFSET].sc
  34. #define    shift_amount(B)        mem[B + SHIFT_OFFSET].sc
  35. #define    list_ptr(B)            link(B + LIST_OFFSET)
  36. #define    glue_order(B)        subtype(B + LIST_OFFSET)
  37. #define    glue_sign(B)        type(B + LIST_OFFSET)
  38. #define    glue_set(B)            mem[B + GLUE_OFFSET].gr
  39.  
  40. #define    NORMAL                0
  41. #define    STRETCHING            1
  42. #define    SHRINKING            2
  43.     
  44. ptr new_rule();
  45.  
  46. #define    RULE_NODE            2
  47. #define    RULE_NODE_SIZE        4
  48. #define    NULL_FLAG            -010000000000
  49. #define    is_running(R)        (R == NULL_FLAG)
  50.  
  51. #define    INS_NODE            3
  52. #define    INS_NODE_SIZE        5
  53. #define    float_cost(I)        mem[I + 1].i
  54. #define    ins_ptr(I)            info(I + 4)
  55. #define    split_top_ptr(I)    link(I + 4)
  56.     
  57. #define    MARK_NODE            4
  58. #define    SMALL_NODE_SIZE        2
  59. #define    mark_ptr(M)            link(M + 1)
  60.     
  61. #define    ADJUST_NODE            5
  62. #define    adjust_ptr            mark_ptr
  63.  
  64. ptr new_ligature();
  65.  
  66. #define    LIGATURE_NODE        6
  67. #define    lig_char(L)            L + 1
  68. #define    lig_ptr(L)            link(lig_char(L))
  69.  
  70. ptr    new_disc();
  71.  
  72. #define    DISC_NODE            7
  73. #define    replace_count        subtype
  74. #define    pre_break            llink
  75. #define    post_break            rlink
  76.  
  77. #define    WHATSIT_NODE        8
  78.  
  79. ptr    new_math();
  80.  
  81. #define    MATH_NODE            9
  82. #define    BEFORE                0
  83. #define    AFTER                1
  84.  
  85. #define    precedes_break(M)    (type(M) < MATH_NODE)
  86. #define    non_discardable(M)    (type(M) < MATH_NODE)
  87.  
  88. ptr    new_spec();
  89. ptr new_param_glue();
  90. ptr new_glue();
  91. ptr new_skip_param();
  92.  
  93. #define    GLUE_NODE            10
  94. #define    COND_MATH_GLUE        98
  95. #define    MU_GLUE                99
  96. #define    A_LEADERS            100
  97. #define    C_LEADERS            101
  98. #define    X_LEADERS            102
  99. #define    glue_ptr            llink
  100. #define    leader_ptr            rlink
  101.  
  102. #define    GLUE_SPEC_SIZE        4
  103. #define    glue_ref_count(G)    link(G)
  104. #define    stretch(G)            mem[G + 2].sc
  105. #define    shrink(G)            mem[G + 3].sc
  106. #define    stretch_order        type
  107. #define    shrink_order        subtype
  108. #define    FIL                    1
  109. #define    FILL                2
  110. #define    FILLL                3
  111.  
  112. ptr new_kern();
  113.  
  114. #define    KERN_NODE            11
  115. #define    EXPLICIT            1
  116. #define    ACC_KERN            2
  117.  
  118. ptr    new_penalty();
  119.  
  120. #define    PENALTY_NODE        12
  121. #define    INF_PENALTY            10000L
  122. #define    EJECT_PENALTY        -INF_PENALTY
  123. #define    penalty(P)            mem[P + 1].i
  124.  
  125. #define    UNSET_NODE            13
  126. #define    span_count            subtype
  127. #define    glue_stretch(U)        mem[U + GLUE_OFFSET].sc
  128. #define    glue_shrink            shift_amount
  129.  
  130. int    print_short_display();
  131. int    print_font_and_char();
  132. int    print_mark();
  133. int    print_rule_dimen();
  134. int    print_glue();
  135. int    print_spec(); 
  136.  
  137. #define    node_list_display(N) \
  138.     {append_char('.'); show_node_list(N); flush_char();}
  139.  
  140. global    int        font_in_short_display;
  141. global    val        depth_threshold;
  142. global    val        breadth_max;
  143. global    int        words;
  144.  
  145. int    show_node_list();
  146. int    show_box();
  147. int    show_info();
  148. int    short_display();
  149.  
  150. ptr    copy_node_list();
  151. int    flush_node_list();
  152.  
  153. int    delete_glue_ref();
  154. #define    fast_delete_glue_ref(G)    \
  155.     {if (glue_ref_count(G) == NULL) \
  156.         free_node(G, GLUE_SPEC_SIZE); \
  157.     else decr(glue_ref_count(G));}
  158. #define    add_glue_ref(G) \
  159.     incr(glue_ref_count(G))
  160.